//
//  FKChooseConsumeDateCell.m
//  WanTao
//
//  Created by Macbook Pro on 2019/5/21.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKChooseConsumeDateCell.h"

@interface FKChooseConsumeDateCell ()

@property (nonatomic, weak) UILabel *titleLabel;

@end

@implementation FKChooseConsumeDateCell


- (void)setupSubviews
{
    [super setupSubviews];
    
    UILabel *titleLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 textAlignment:NSTextAlignmentCenter];
    [self.contentView addSubview:titleLabel];
    self.titleLabel = titleLabel;
    titleLabel.numberOfLines = 0;
    [titleLabel fk_viewCornerRadius:0 borderWidth:0.8 borderColor:fkColor999999];
    
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
    }];
}

- (void)setData:(id)data
{
    [super setData:data];
    
    self.titleLabel.text = fkFORMAT(@"%@\n(剩余%@名额)", data[@"reserve_time"], data[@"reserve_nums"]);
}

- (void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    
    
    if (selected) {
        self.titleLabel.backgroundColor = fkMainColor;
        self.titleLabel.textColor = [UIColor whiteColor];
        self.titleLabel.layer.borderColor = fkMainColor.CGColor;
    } else {
        self.titleLabel.backgroundColor = [UIColor whiteColor];
        self.titleLabel.textColor = fkColor333333;
        self.titleLabel.layer.borderColor = fkColor999999.CGColor;
    }
}

@end
